<template>
  <div class="newsinfo">
    <van-nav-bar
      class="title"
      :title="this.$route.meta.title"
      left-text="返回"
      left-arrow
      @click-left="onClickLeft"
    />
    <van-list class="list" v-html="news.newsDetail"> </van-list>
  </div>
</template>
<script>
export default {
  props: ["id"],
  data() {
    return {
      news: [],
    };
  },
  methods: {
    onClickLeft() {
      this.$router.go(-1);
    },
    async getNews() {
      console.log(this.id);
      const res = await this.$http.getNewsDate(this.id);
      this.news = res.data;
    },
  },
  created() {
    this.getNews();
  },
};
</script>
<style lang="scss" scoped>
.newsinfo {
  padding: 0 10px;
  img {
    display: block;
  }
  .title {
    position: fixed;
    width: 100%;
    top: 0;
  }
  .list {
    margin-top: 46px;
    font-size: 14px;
    color: #333;
  }
}
</style>
